package com.bcs.codgen.model;

import java.io.Serializable;

/**
 * 索引模型
 * @author 黄天政
 *
 */
public class IndexInfoModel implements Serializable{
	private static final long serialVersionUID = -7634955376647599763L;
	private String tableCat;
	private String tableSchem;
	private String tableName;
	/**
	 * 索引值是否可以不唯一,TYPE为 tableIndexStatistic时索引值为 false;
	 */
	private boolean nonUnique;
	/**
	 * 索引类别（可能为空）,TYPE为 tableIndexStatistic 时索引类别为 null;
	 */
	private String indexQualifier;
	/**
	 * 索引的名称 ;TYPE为 tableIndexStatistic 时索引名称为 null;
	 */
	private String indexName;
	/**
	 * 索引类型：
	 *  tableIndexStatistic - 此标识与表的索引描述一起返回的表统计信息
	 *  tableIndexClustered - 此为集群索引
	 *  tableIndexHashed - 此为散列索引
	 *  tableIndexOther - 此为某种其他样式的索引
	 */
	private short type;
	/**
	 * 在索引列顺序号;TYPE为 tableIndexStatistic 时该序列号为零;
	 */
	private short ordinalPosition;
	/**
	 * 列名;TYPE为 tableIndexStatistic时列名称为 null;
	 */
	private String columnName;
	/**
	 * 列排序顺序:升序还是降序[A:升序; B:降序];如果排序序列不受支持,可能为 null;TYPE为 tableIndexStatistic时排序序列为 null;
	 */
	private String ascOrDesc;
	/**
	 * 基数;TYPE为 tableIndexStatistic 时,它是表中的行数;否则,它是索引中唯一值的数量。
	 */
	private int cardinality;
	/**
	 * TYPE为 tableIndexStatisic时,它是用于表的页数,否则它是用于当前索引的页数。
	 */
	private int pages;
	/**
	 * 过滤器条件,如果有的话(可能为 null)。
	 */
	private String filterCondition;

	public String getTableCat() {
		return tableCat;
	}

	public void setTableCat(String tableCat) {
		this.tableCat = tableCat;
	}

	public String getTableSchem() {
		return tableSchem;
	}

	public void setTableSchem(String tableSchem) {
		this.tableSchem = tableSchem;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public boolean isNonUnique() {
		return nonUnique;
	}

	public void setNonUnique(boolean nonUnique) {
		this.nonUnique = nonUnique;
	}

	public String getIndexQualifier() {
		return indexQualifier;
	}

	public void setIndexQualifier(String indexQualifier) {
		this.indexQualifier = indexQualifier;
	}

	public String getIndexName() {
		return indexName;
	}

	public void setIndexName(String indexName) {
		this.indexName = indexName;
	}

	public short getType() {
		return type;
	}

	public void setType(short type) {
		this.type = type;
	}

	public short getOrdinalPosition() {
		return ordinalPosition;
	}

	public void setOrdinalPosition(short ordinalPosition) {
		this.ordinalPosition = ordinalPosition;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getAscOrDesc() {
		return ascOrDesc;
	}

	public void setAscOrDesc(String ascOrDesc) {
		this.ascOrDesc = ascOrDesc;
	}

	public int getCardinality() {
		return cardinality;
	}

	public void setCardinality(int cardinality) {
		this.cardinality = cardinality;
	}

	public int getPages() {
		return pages;
	}

	public void setPages(int pages) {
		this.pages = pages;
	}

	public String getFilterCondition() {
		return filterCondition;
	}

	public void setFilterCondition(String filterCondition) {
		this.filterCondition = filterCondition;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("IndexInfoModel{");
		sb.append("tableCat='").append(tableCat).append('\'');
		sb.append(", tableSchem='").append(tableSchem).append('\'');
		sb.append(", tableName='").append(tableName).append('\'');
		sb.append(", nonUnique=").append(nonUnique);
		sb.append(", indexQualifier='").append(indexQualifier).append('\'');
		sb.append(", indexName='").append(indexName).append('\'');
		sb.append(", type=").append(type);
		sb.append(", ordinalPosition=").append(ordinalPosition);
		sb.append(", columnName='").append(columnName).append('\'');
		sb.append(", ascOrDesc='").append(ascOrDesc).append('\'');
		sb.append(", cardinality=").append(cardinality);
		sb.append(", pages=").append(pages);
		sb.append(", filterCondition='").append(filterCondition).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
